alien0 = {'color':'green','point':5}
print(alien0['color'])
print(alien0['point'])

alien0['x_position'] = 0
alien0['y_position'] = 25

print(alien0)

alien0 = {}
alien0['color'] = 'red'
alien0['point'] = 100
print (alien0)

alien0['color'] = 'yellow'
print(alien0)
del alien0['color']
print(alien0)


favorite_languages = {
	'jen':'python',
	'sarah':'c',
	'eward':'ruby',
	'phil':'python'

}

print(favorite_languages)

print('sarah`s favorite language is ' + favorite_languages['sarah'])


print("\n##########################prac-6.2#########################") 
aquaintance = {
	'first_name' : 'L',
	'last_name' : 'xin',
	'age' : 8888,
	'city' : 'gz'
}

print(aquaintance)


favorite_number = {
	'zs' : 5555,
	'ls' : 54,
	'ww' : 65,
	'zl' : 7733,
	'tq' : 76,
	'wb' : 5454,
	'wb1' : 5454,
	'wb3' : 5454,
	'wb4' : 5454,
}

print(favorite_number)

for k,v in favorite_number.items():
	print('key : ' + k)
	print('value: ' + str(v))
	print()

for k in sorted(favorite_number.keys()):
	print(k)

for v in favorite_number.values():
	print(v)


for v in sorted(favorite_number.values()):
	print(v)

print()

for v in set(sorted(favorite_number.values())):
	print(v)

alien0 = {'color':'green','point':5}
alien1 = {'color':'red','point':15}
alien2 = {'color':'yellow','point':10}

aliens = [alien0,alien1,alien2]
for item in aliens:
	print(item)

aliens = []
for i in range(30):
	aliens.append({'color':'green','point':5,'speed':'slow'})

for i in aliens[:5]:
	print(i)

print('total aliens number is :' + str(len(aliens)))

for i in aliens[:3]:
	i['color'] = 'yellow'
	i['point'] = 15
	i['speed'] = 'medium'

aliens2 = aliens[:]
for i in aliens2:
	i['color'] = 'yellow'
	i['point'] = 15
	i['speed'] = 'medium'


print('-------')
for i in aliens:
	print(i)

print('-------')
test = ['aa',{'aa':'dd','bb':'cc'},'cc','dd']
test2 = test[:2]
for i in test2:
	if(i != 'aa'):
		i['aa'] = 'hehe'
	else:
		i = 'hehe'

print(test)
print(test2)











